package com.zsyg.sys.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import com.zsyg.sys.entity.SysMenu;
import com.zsyg.sys.mapper.SysMenuMapper;
import com.zsyg.sys.service.SysMenuService;
import com.zsyg.common.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 菜单表 服务实现类
 * </p>
 *
 * @author YangWanLi
 * @since 2018-08-16
 */
@Service
public class SysMenuServiceImpl extends BaseServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {

    @Autowired
    private SysMenuMapper sysMenuMapper;

    /**
     * 分页
     * @param page
     * @param sysMenu
     * @return
     */
    @Override
    public PageInfo<SysMenu> findPage (Page<SysMenu> page, SysMenu sysMenu){
        page = PageHelper.startPage(page.getPageNum(),page.getPageSize());
        sysMenuMapper.findAll(sysMenu);
        return page.toPageInfo();
    }

}
